Skip to content

Conversation

@brianrourkeboll
Copy link
Contributor

@brianrourkeboll brianrourkeboll commented Oct 25, 2025

Description

Fixes #18993.
Fixes #6069.

  • Emit "error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation" for generic struct types that recursively reference themselves but (infinitely) lift their generic type parameter.

I don't know if "lifting" is the correct term for this; let me know if there is a more correct term or phrase that I should use to describe this in the comment and the tests. Maybe nested app ty/type application?

Checklist

  • Test cases added.
  • Release notes entry updated.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 25, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.0.md

@brianrourkeboll brianrourkeboll marked this pull request as ready for review October 25, 2025 17:23
@brianrourkeboll brianrourkeboll requested a review from a team as a code owner October 25, 2025 17:23
@edgarfgp
Copy link
Contributor

I think this PR might also fix #6069 ?

@brianrourkeboll
Copy link
Contributor Author

I think this PR might also fix #6069 ?

Hmm yes, probably. I will add a test/tests for mutually-recursive structs.

@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Nov 3, 2025
@T-Gro T-Gro merged commit 9670f60 into dotnet:main Nov 3, 2025
38 checks passed
@brianrourkeboll brianrourkeboll deleted the recursive-generic-struct-types branch November 3, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Compilation fails to terminate for polymorphic recursion on value types Infinite loop on expanding cycle for struct types

3 participants